Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 64-bit time_t on 32 bit architectures #236

Merged
merged 4 commits into from
Mar 24, 2024
Merged

Fix 64-bit time_t on 32 bit architectures #236

merged 4 commits into from
Mar 24, 2024

Conversation

martinpitt
Copy link
Owner

@martinpitt martinpitt commented Mar 24, 2024

Thanks to @vorlonofportland and @liuzixing for these! Taken from ubuntu delta, package can be re-synced after landing this and making a new release.

Fixes #216

Latest gcc on Debian unstable i386 starts to fail with

> tests/test-umockdev-vala.vala:714:19: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
>     xfer[0].tx_buf = (uint64) tx_buf;

It's right -- this *is* an evil and wrong cast, but unfortunately Linux
defines the struct precisely as that -- `u64`, on all platforms. As we
can't selectively `#pragma` these away, disable the fatal warning
globally.
@martinpitt
Copy link
Owner Author

This needs some love on Alpine

@martinpitt martinpitt marked this pull request as draft March 24, 2024 10:06
Zixing Liu and others added 3 commits March 24, 2024 11:34
Unsetting `_FILE_OFFSET_BITS` causes time_t to be treated as 32-bit
instead of the 64-bit that we want with `-D_TIME_BITS=64`.

Fixes #216

Co-Authored-By: Steve Langasek <[email protected]>
Co-Authored-By: Martin Pitt <[email protected]>
The structure of struct input_event varies depending on whether 64-bit
`time_t` is in use.
@martinpitt martinpitt marked this pull request as ready for review March 24, 2024 10:49
@martinpitt martinpitt merged commit 635c86e into main Mar 24, 2024
39 checks passed
@martinpitt martinpitt deleted the time64 branch March 24, 2024 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

32bit test fails on when built with -D_TIME_BITS=64
2 participants